package main

import (
	"mymath"
	"fmt"
)
//全局变量 用var
var i = 10
func main() {
	fmt.Printf("Hello, world.  Sqrt(2) = %v\n", mymath.Sqrt(2))
	a, b, c := 0, 1, 2
	print(a)
	print(b)
	print(c)

	const MIAO  = "喵喵"
	const MAX_THREAD  = 10
//	var ii int = 11;
	prints(MIAO);
	var d complex64 = 5+5i
	fmt.Println(d)
	test()
	test2()
}

func print(s int){
	fmt.Println(s)
}
func prints(s string){
	fmt.Println(s)
}

var sayHello string
var sayHello1 string = ""
func test()  {
	a,b,c,d,e := "a","b","c","d","e"
	prints(a)
	prints(b)
	prints(c)
	prints(d)
	prints(e)
	var s = "hello"
	prints(s)
	bytes :=[] byte(s)
	fmt.Println(bytes)
	bytes[0] ='c'
	fmt.Println(bytes)
	s = string(bytes)
	fmt.Println(s)
}

func test2()  {
	//字符串切片
	s:="hello world"
	s1:= "hi " + s[6:]
	prints(s1)

	m:=`hello
	world
	呵呵`
	prints(m)

}